﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>


<!DOCTYPE html>
<html>
<head>
	<base href="${basePath}"/>
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
  	<meta name="viewport" content="width=device-width, initial-scale=1">
    <title>批量操作 </title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
     
	<%@include file="../disable_cache.jsp" %>
	<link rel="stylesheet" href="bootstrap/css/formValidation.css"/>	
	<%@include file="../common_resource.jsp" %>
	<!-- Mainly scripts -->
	
	
	<script type="text/javascript" src="js/jquery-confirm.js"></script>
	<script src="bootstrap/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="bootstrap/js/formValidation.js"></script>
 	<script type="text/javascript" src="bootstrap/js/framework/bootstrap.js"></script>
	
<style type="text/css">
#updateUserModal{
	margin-top: -30px;
}
#updateUserModal .modal-body {
	margin: -25px;
}
</style>
<script type="text/javascript">

$(function(){
	$("#checkall").click(function() { 
		$("input[name='selecteNOs']").prop("checked",this.checked); 
		}); 
	
	
	/* 批量删除 */ 
  $('#delUser').click(function(){
        var checkedNum = $("input[name='selecteNOs']:checked").length; 
      	if(checkedNum == 0){
      		$("#selectDengerModal").modal();
	   		return;
      	}
      	$("#delOKModal").modal();
      	$("#OKBtn").click(function(){
      			$("#OKBtn").attr("data-dismiss","modal");
      			var checkedList = new Array(); 
				$("input[name='selecteNOs']:checked").each(function() { 
					checkedList.push($(this).val()); 
				}); 
				$.post("user/delectUser.do",{'selectedNos':checkedList.toString()},function(json) { 
					if(json.row == 1){
						$("input[name='selecteNOs']:checked").parent().parent().remove(); 
						$("#delSuccessModal").modal();
					}else{
						$("#delFeildModal").modal();
					}
			},'json');
      	});
     });
	  
	
  /* 修改 */

	 
});


</script>

</head>
<body class="main_body">
<div class="container container-1180" >              
<div style="margin-top: 10px;">
	<form action="user/selectAllByPage.do" role="form" class="form-inline" method="post">
			<br/><br/><label for="bttn"  style="font-size: 14px;">授课院校：</label>
			<div class="input-group input-group-lg">
         		<div class="input-group">
         		<span class="input-group-addon " ><span class="glyphicon glyphicon-search"></span></span>
               <input id="bttn"  name="graduateSchool" placeholder="请输入授课院校名称" type="text" class="form-control">
               <div class="input-group-btn">
                  <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"> 
                  	请选择院校 <span class="caret"></span>
                  </button>
                  <ul id="dataUl" class="dropdown-menu pull-right"></ul>
               </div><!-- /btn-group -->
            </div><!-- /input-group -->
      		<button id="bt" type="submit" value="go" class="btn btn-primary btn-sm" style="margin-top: 5px;margin-left: 30px;">
      			&nbsp;Go!
      		</button>
      			
      		</div>
	</form>
</div>
	<br><br><br>
	
	<div class="panel panel-info">
		<div class="panel-heading">
			<span ><i class="fa fa-user"></i></span>
			<label>
				<font style="font-weight: bold;margin-left: 10px;">学&nbsp;员&nbsp;列&nbsp;表</font>
			</label>
		</div>
		<div class="panel-body">
		<form id="myForm" action="javascript:void(0)" method="post">
			<table class="table table-hover">
			   <caption>学员信息表</caption>
			   <thead>
			      <tr class="success">
			        <th width="20px" style="text-align:center;">序号</th>
		  			<th width="50px" >姓名</th>
		  			<th width="90px" style="text-align:center;">身份证号码</th>
		  			<th width="100px" style="text-align:center;">专业</th>
		  			<th width="50px" style="text-align:center;">最高学历</th>
		  			<th width="70px" style="text-align:center;">手机号码</th>
		  			<th width="70px" style="text-align:center;">QQ号码</th>
		  			<th width="50px" style="text-align:center;">操作</th>
			      </tr>
			   </thead>
			   <tbody >
			   <c:forEach var="user" items="${usersall}" varStatus="statu">
			   <tr class="">
			        <td width="20px" style="text-align:center;">
			        	
			        	<input name="selecteNOs" type="checkbox" class="chk-box" value="${user.id}"/> &nbsp;&nbsp;${statu.count }</td>
		  			<td width="50px" >${user.userName}</td>
		  			<td width="90px" style="text-align:center;">${user.idCardNo}</td>
		  			<td width="100px" style="text-align:center;">${user.marjor}</td>
		  			<td width="50px" style="text-align:center;">${user.eduBackground}</td>
		  			<td width="70px" style="text-align:center;">${user.mobile}</td>
		  			<td width="70px" style="text-align:center;">${user.qq}</td>
		  			<td width="50px" style="text-align:center;">
		  				<a class="btn btn-primary btn-xs"  href="user/selectByPK.do?userId=${user.id}" 
		  					data-keyboard="true" data-backdrop="static"
		  					data-remote="false" data-toggle="modal" data-target="#updateUserModal">
							<i class="fa fa-edit fa-white"></i>Edit                                   
						</a>
					</td>
			      </tr>
			      
			   </c:forEach>
			      <tr class="warning">
					<td colspan="8" style="padding-left: 10px;">

						<input type="checkbox" id="checkall" onclick="checkAll()"  class="chk-box" style="margin-right: 7px;"/>全选
						
						&nbsp;&nbsp;&nbsp;
						<a id="delUser"  class="btn btn-primary btn-xs "  href="javascript:void(0);" 
							data-toggle="tooltip" data-placement="right" title="删除后不可恢复">
							<i class="fa fa-bank"></i>  
							批量删除                                           
						</a>&nbsp;<font color="red" size="2">(删除后不可恢复)</font>
					</td>
				  </tr>
			   </tbody>
			</table>
			</form>
		<%-- <div class="pager" style="padding-left: 20px;background-color: #FAEBD7">
		<c:if test="${not empty usersPage}">
			<p:page url="user/selectAllByPage.do?x=1" page="${usersPage}"  displayStyle="icon" />
		</c:if>
	  </div> --%>
		</div>
	</div>
 </div>
 
 </div>   <!-- container end -->
<script type="text/javascript">
$(".data_list tr:last").unbind("mouseover");
$(".data_list tr:last").unbind("mouseout");
</script>
<div id="dialog" title="更新用户" style="display: none;"></div>


  <div id="updateUserModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="updateUserModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
      <div class="modal-content">
        <div id="formContent" class="modal-body">
         	
        </div>
        <!-- <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
          <button id="saveBtn" type="button" class="btn btn-primary" >保存</button>
        </div> -->
      </div>
    </div>
  </div>
 




<script type="text/javascript">
//$('#updateUserModal').modal({backdrop: 'static', keyboard: false});
$("#updateUserModal").on("show.bs.modal", function(e) {
    var link = $(e.relatedTarget);
    $(this).find(".modal-body").load(link.attr("href"));
});
</script>
<%@include file="../myModal.jsp" %>
</body>
</html>
